package com.imcrl.core.config
{
	import flash.utils.getTimer;
	
	import mx.utils.StringUtil;
	
	/**
	 * 配置文件 中的services节点;
	 * @author crl
	 * 
	 */	
	public class ServiceSection extends ResourceSection
	{
		/**
		 * 是否添加随机参数; 
		 */		
		private var r:Boolean=false;
		public function ServiceSection()
		{
		}
		
		override public function bindXML(xml:XML):void{
			super.bindXML(xml);
			r = StringUtil.trim(xml.@r) !="";
		}
		
		override public function get value():String{
			if(_inited){
				return _value;
			}
			_value=super.value;
			
			if(r){
				var sp:String="?";
				if(_value.indexOf(sp)!=-1){
					sp="&";
				}
				//为它加一随机数;
				_value = _value + sp+ "r="+(getTimer()+Math.random()*10);
			}
			return _value;
		}
	}
}